﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GestionDeCinebox.Classes
{
    public class MD5Hash
    {
        public MD5Hash()
        {

        }

        public String Hash(String value)
        {
            byte[] bs = Encoding.UTF8.GetBytes(value);
            MD5Managed md5 = new MD5Managed();
            byte[] hash = md5.ComputeHash(bs);
            StringBuilder sb = new StringBuilder();
            foreach (byte b in hash)
            {
                sb.Append(b.ToString("x2").ToLower());
            }
            return sb.ToString();
        }
    }
}
